﻿@inherits RegisterPage
@page "/account/register"

@layout LoginLayout


<EditForm Model="@registerViewModel" OnValidSubmit="@RegisterUser">
    <MudCard Elevation="2" Class="pa-4">
        <MudCardHeader>
            <CardHeaderContent>
                <MudIconButton Icon="@Icons.Material.Filled.Home" Class="ml-auto" Link="/" />
                <div class="logo">
                    <a href="/" title="@appState.AppName Home"><img src=@($"{Module.ContentPath}/images/logo.svg") style="width:100px;" title="@appState.AppName Home" alt="@appState.AppName" /><br />@appState.AppName</a>
                    <br />
                </div>
                <MudText Typo="Typo.h5" Align="Align.Center">@L["Registration"]</MudText>
            </CardHeaderContent>
        </MudCardHeader>
        <MudCardContent>
            <FluentValidationValidator />
            <MudValidationSummary />
            <MudTextField @bind-Value="@registerViewModel.UserName" Label=@L["UserName"] AdornmentIcon="@Icons.Material.Filled.Person" Adornment="Adornment.End" FullWidth="true" Required="true" RequiredError=@L["Required"]></MudTextField>

            <MudTextField @bind-Value="@registerViewModel.Email" Label=@L["Email"] AdornmentIcon="@Icons.Material.Outlined.Mail" Adornment="Adornment.End" FullWidth="true" Required="true" RequiredError=@L["Required"]></MudTextField>

            <MudTextField @bind-Value="@registerViewModel.Password" Label=@L["Password"] AdornmentIcon="@Icons.Material.Outlined.Lock" Adornment="Adornment.End" FullWidth="true" Required="true" RequiredError=@L["Required"] InputType="InputType.Password"></MudTextField>

            <MudTextField @bind-Value="@registerViewModel.PasswordConfirm" Label=@L["Password Confirmation"] AdornmentIcon="@Icons.Material.Outlined.Lock" Adornment="Adornment.End" FullWidth="true" Required="true" RequiredError=@L["Required"] InputType="InputType.Password"></MudTextField>

        </MudCardContent>
        <MudCardActions>
            <MudButton ButtonType="ButtonType.Submit" Variant="Variant.Filled" Color="Color.Primary" Class="ml-auto">@L["Register"]</MudButton>
        </MudCardActions>
        <MudButton Link="account/login" Color="Color.Primary">
            @L["AlreadyRegistered"]
        </MudButton>
    </MudCard>
</EditForm>

@code {

}
